 CC=g++
 CFLAGS=-Wall -pedantic
 LDFLAGS=
 
LIB=libeasyunit.a

EXEC=vertexCoverTest

SRC= $(wildcard *.cpp)
OBJ= $(SRC:.cpp=.o)


SOURCE_DIR=../source
BUILDER_DIR=$(SOURCE_DIR)/builder
FACTORY_DIR=$(SOURCE_DIR)/factory
STRATEGY_DIR=$(SOURCE_DIR)/strategy

SRC_SOURCE= $(wildcard $(SOURCE_DIR)/*.cpp)
OBJ_SOURCE= $(SRC_SOURCE:.cpp=.o)

SRC_BUILDER= $(wildcard $(BUILDER_DIR)/*.cpp)
OBJ_BUILDER= $(SRC_BUILDER:.cpp=.o)

SRC_FACTORY= $(wildcard $(FACTORY_DIR)/*.cpp)
OBJ_FACTORY= $(SRC_FACTORY:.cpp=.o)

SRC_STRATEGY= $(wildcard $(STRATEGY_DIR)/*.cpp)
OBJ_STRATEGY= $(SRC_STRATEGY:.cpp=.o)

all: $(EXEC)
 
$(EXEC): $(OBJ)
	g++ $(OBJ_SOURCE) $(OBJ_BUILDER) $(OBJ_FACTORY) $(OBJ_STRATEGY) $(OBJ) -o $(EXEC) $(LIB) $(LDFLAGS)
	
%.o: %.cpp
	@$(CC) -o $@ -c $< $(CFLAGS)
	
clean:
	rm -f *.gch

mrproper: clean
	rm -f *.o $(EXEC)
